package com.lc202309;

/**
 * Description:
 *
 * @Create 2023/9/5 23:42
 * @Version 1.0
 */
public class Solution2605 {
    public int minNumber(int[] nums1, int[] nums2) {
        int min = Integer.MAX_VALUE;
        for (int i = 0; i < nums1.length; i++) {
            for (int j = 0; j < nums2.length; j++) {
                if (nums1[i] == nums2[j]) {
                    min = Math.min(min, nums1[i]);
                } else {
                    min = Math.min(min, Math.min(nums1[i], nums2[j]) * 10 + Math.max(nums1[i], nums2[j]));
                }
            }
        }
        return min;
    }
}
